﻿using System.Windows;
using System.Windows.Controls;
namespace IdResourceModule.Views
{
    /// <summary>
    /// Interaction logic for MeasurementResultStatistic
    /// </summary>
    public partial class PatientList : UserControl
    {
        public PatientList()
        {
            InitializeComponent();
        }
        private void BtnSearch_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            pgtList.PageIndex = 1;
        }
        private void menuCopyName_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var info = ListViewPatientInfos.SelectedItem as CoreModule.PatientInfo;
            if (info == null)
            {
                return;
            }
            if (string.IsNullOrWhiteSpace(info.PatientName))
            {
                return;
            }
            Clipboard.SetText(info.PatientName);
        }
        private void menuCopyWdCode_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var info = ListViewPatientInfos.SelectedItem as CoreModule.PatientInfo;
            if (info == null)
            {
                return;
            }
            if (string.IsNullOrWhiteSpace(info.WdCode))
            {
                return;
            }
            Clipboard.SetText(info.WdCode + "");
        }
        private void menuCopySocialCard_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var info = ListViewPatientInfos.SelectedItem as CoreModule.PatientInfo;
            if (info == null)
            {
                return;
            }
            if (string.IsNullOrWhiteSpace(info.SocialCard))
            {
                return;
            }
            Clipboard.SetText(info.SocialCard);
        }
        private void menuCopyIdCard_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var info = ListViewPatientInfos.SelectedItem as CoreModule.PatientInfo;
            if (info == null)
            {
                return;
            }
            if (string.IsNullOrWhiteSpace(info.IdCard))
            {
                return;
            }
            Clipboard.SetText(info.IdCard);
        }
    }
}
